<?php

/**
 * Created by PhpStorm.
 * User: DaXiong
 * Date: 2021/4/2
 * Time: 12:53 AM
 */

namespace App\Http\Controllers\Api;


use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class TestController extends Controller
{

    public function index($id)
    {
//        //取得所有的表名
//        foreach (DB::getDoctrineSchemaManager()->listTables() as $key => $val) {
//            /**@var $val Table**/
//            $tables[$key]['TABLE_NAME'] = $val->getName();
//            $tables[$key]['TABLE_COMMENT'] = $val->getOptions()['comment'];
//            foreach (DB::getDoctrineSchemaManager()->listTableColumns($val->getName()) as  $detail) {
//                /**@var $detail Column**/
//                $tables[$key]['COLUMN'][] = [
//                    'COLUMN_COMMENT' => $detail->getComment(), 'COLUMN_NAME' => $detail->getName(),
//                    'COLUMN_TYPE' => $detail->getType()->getName(), 'COLUMN_DEFAULT' => $detail->getDefault(),
//                    'IS_NULLABLE' => $detail->getNotnull(), 'EXTRA' => $detail->getAutoincrement(),
//                ];
//            }
//        }
//        dd($tables);
        dd($id);
        return $this->success($id);
    }

}